package com.example.service.impl;

import com.example.pojo.GsRestoreRecord;
import com.example.mapper.GsRestoreRecordMapper;
import com.example.service.IGsRestoreRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.vo.ResultVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 物品归还记录表 服务实现类
 * </p>
 *
 * @author wsl
 * @since 2022-05-12
 */
@Service
public class GsRestoreRecordServiceImpl extends ServiceImpl<GsRestoreRecordMapper, GsRestoreRecord> implements IGsRestoreRecordService {

    //查询物品归还记录
    @Override
    public ResultVo selectGsRestoreRecord(String emp_name,String name) {
        List<GsRestoreRecord> list= baseMapper.selectGsRestoreRecord(emp_name,name);
        return ResultVo.response(list);
    }

    //新增物品归还记录
    @Override
    public ResultVo addGsRestoreRecord(GsRestoreRecord gsRestoreRecord) {
        int i=baseMapper.insert(gsRestoreRecord);
        return i > 0 ? ResultVo.success("归还成功") : ResultVo.error("归还失败");
    }
}
